package com.school.system.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.school.common.annotation.Excel;
import com.school.common.core.domain.BaseEntity;

import java.util.Date;

import static com.school.system.constances.GlobalConstance.APPLY_BACK;

/**
 * 通告表对象 announcement
 *
 * @author fulin
 * @date 2023-03-09
 */
public class Announcement extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private Announcement() {
    }

    public static Announcement getInstance(int contentId, long userId) {
        Announcement announcement = new Announcement();
        announcement.setContentId(contentId);
        announcement.setCreateId(userId);
        announcement.setContent(APPLY_BACK);
        announcement.setCreateTime(new Date());
        return announcement;
    }

    public static Announcement getInstanceInit() {
        Announcement announcement = new Announcement();
        announcement.setStatus("0");
        return announcement;
    }

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 内容
     */
    @Excel(name = "内容")
    private String content;

    /**
     * 状态(0未读1已读)
     */
    @Excel(name = "状态(0未读1已读)")
    private String status;

    /**
     * 操作人姓名
     */
    @Excel(name = "操作人姓名")
    private String operaName;

    /**
     * 操作人id
     */
    @Excel(name = "操作人id")
    private Long operaId;
    @Excel(name = "是否通过 0通过 1拒绝")
    private String enable;

    private long createId;

    @Excel(name = "操作表单id")
    private int contentId;

    public long getCreateId() {
        return createId;
    }

    public void setCreateId(long createId) {
        this.createId = createId;
    }

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable;
    }

    public int getContentId() {
        return contentId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setOperaName(String operaName) {
        this.operaName = operaName;
    }

    public String getOperaName() {
        return operaName;
    }

    public void setOperaId(Long operaId) {
        this.operaId = operaId;
    }

    public Long getOperaId() {
        return operaId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createBy", getCreateBy())
                .append("content", getContent())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("operaName", getOperaName())
                .append("operaId", getOperaId())
                .toString();
    }
}
